/*
 * Filename:    DocumentDaoImpl.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014-11-6
 */
package com.paic.mhis.hcpms.common.document.intergration.dao;

import java.util.List;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.paic.mhis.hcpms.audit.dto.AuditCaseDTO;
import com.paic.mhis.hcpms.common.document.dto.DocContentDTO;
import com.paic.mhis.hcpms.common.document.dto.DocContentKeyDTO;
import com.paic.mhis.hcpms.common.document.dto.DocParameterCondition;
import com.paic.mhis.hcpms.common.document.dto.DocumentDTO;
import com.paic.mhis.hcpms.common.document.intergration.DocumentDao;
import com.paic.pafa.biz.dao.BaseDAO;

@Component("documentDaoImpl")
public class DocumentDaoImpl extends BaseDAO implements DocumentDao {

	@Transactional
	@Override
	public void saveDocumentDTO(DocumentDTO bean) {
		this._insert("document.insertDocumentDTO", bean);
	}

	@Transactional
	@Override
	public void saveDocContentKeyDTO(DocContentKeyDTO bean) {

		this._insert("document.insertDocContentKeyDTO", bean);

	}

	@Transactional
	@Override
	public void saveDocContentDTO(DocContentDTO bean) {
		this._insert("document.insertDocContentDTO", bean);

	}

	@Transactional
	@Override
	public void updateDocumentDTO(DocumentDTO bean) {

		this._update("document.updateDocumentDTO", bean);

	}

	@Transactional
	@Override
	public void updateDocument(AuditCaseDTO bean) {
		this._update("document.updateDocument", bean);
	}

	@Transactional
	@Override
	public void updateDocContentKeyDTO(DocContentKeyDTO bean) {
		this._update("document.updateDocContentKeyDTO", bean);

	}

	@Transactional
	@Override
	public void updateDocContentDTO(DocContentDTO bean) {
		this._update("document.updateDocContentDTO", bean);

	}

	public List<DocContentDTO> queryByDocParameterCondition(DocParameterCondition parameter) {
		List<DocContentDTO> list = (List<DocContentDTO>) this._queryForList("document.queryDocContentDTO", parameter);
		return list;
	}

	@Override
	public List<DocumentDTO> queryDocumentDTO(DocParameterCondition parameter) {

		List<DocumentDTO> list = (List<DocumentDTO>) this._queryForList("document.queryDocumentDTO", parameter);

		return list;
	}

}
